import {defineStore} from "pinia";
import {getCityAll} from "@/services";

const useCity = defineStore('city', {
   state: () => ({
      allCity: {},
      myCity: {
         cityId: 45,
         cityName: "广州",
         pinYin: "guangzhou",
         gangAoTai: false,
         hot: false,
         longitude: "113.271",
         latitude: "23.1354"
      }
   }),
   getters: {},
   actions: {
      async fetchCity() {
         const res = await getCityAll()
         this.allCity = res.data
      }
   }
})

export default useCity